//
//  GSDKUpdateDataController.m
//  GameSDK
//
//  Created by Johnny on 2017/8/7.
//  Copyright © 2017年 Johnny. All rights reserved.
//

#import "GSDKUpdateDataController.h"
#import "GSDKComplatformBase.h"
#import "GSDKCommonMethod.h"
@implementation GSDKUpdateDataController
- (void)checkUpdate:(GSDKResGameVersionModel *)model {
    GSDKCOMMONMETHOD.versionModel = model;
    if (model.is_force_update != nil) {
        if ([model.is_force_update isEqualToString:@"1"]) {
            if (![model.max_version_name isEqualToString:GSDKINITCONFIGURE.versionName] || ![model.max_version isEqualToString:GSDKINITCONFIGURE.version]) {
                GSDKVersionStatus * version = [[GSDKVersionStatus alloc] init];
                version.downLoadUrl = model.download_url;
                GSDKMessageStatus * message = [[GSDKMessageStatus alloc] init];
                message.code = model.code;
                message.msg = model.message;
                [[NSNotificationCenter defaultCenter] postNotificationName:GSDKCheckGameUpdateFinishNotification object:nil userInfo:@{@"GSDKVersionStatus": version, @"GSDKMessageStatus": message}];
                return;
            }
        }
    }
}
@end
